import wx
class PicBtn(wx.BitmapButton):
    def __init__(self,parent,id,picpath1,picpath2,size,tip):
        wx.BitmapButton.__init__(self,parent,id,style = wx.NO_BORDER)
          
        self.bmp1 = wx.BitmapFromImage(wx.Image(picpath1,wx.BITMAP_TYPE_ANY))
        self.bmp2 = wx.BitmapFromImage(wx.Image(picpath2,wx.BITMAP_TYPE_ANY))
        
        self.SetSize((self.bmp1.GetWidth(), self.bmp1.GetHeight()))
        self.SetBitmapLabel(self.bmp1)
        self.SetBitmapHover(self.bmp2)
        self.SetBitmapSelected(self.bmp2)
        

if __name__ == "__main__":

    app = wx.PySimpleApp()
    frame = wx.Frame(None,-1)
    panel = wx.Panel(frame,-1)

    picbutn = PicBtn(panel,-1,"D:/test/x2.bmp","D:/test/x1.bmp",(30,15),"test tip")
    frame.Show()
    app.MainLoop()

        